package com.javaGather.day1;

import java.util.ArrayList;

public class Test1 {

    public static void main(String[] args) {

        Student s1 = new Student("s1", 12);
        Student s2 = new Student("s2", 12);
        Student s3 = new Student("s3", 13);
        Student s4 = new Student("s4", 14);
        Student s5 = new Student("s5", 12);


        ArrayList<Student> students = new ArrayList<>();
        students.add(s1);
        students.add(s2);
        students.add(s3);
        students.add(s4);
        students.add(s5);

        for (int i = 0; i < students.size(); i++) {
            System.out.println(students.get(i));
            System.out.println(students.get(i).getName());
            System.out.println(students.get(i).getAge());
        }
    }

}
